// import './assets/main.css'

// import { createApp } from 'vue'
// import { createPinia } from 'pinia'
// import ElementPlus from 'element-plus'
// import 'element-plus/dist/index.css'
// import Vant from 'vant';
// import 'vant/lib/index.css';

// import App from './App.vue'
// import router from './router'
// import { useUserStore } from './stores/user';

// const app = createApp(App)
// const pinia = createPinia()
// app.use(pinia)
// app.use(router)
// app.use(ElementPlus)
// app.use(Vant);

// // 获取用户状态管理实例
// const userStore = useUserStore(pinia);
// // 初始化用户状态，从会话存储恢复登录信息


// app.mount('#app')







// src/main.ts
import './assets/main.css';
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import Vant from 'vant';
import 'vant/lib/index.css';
import App from './App.vue';
import router from './router'; // 引入路由配置
import { useUserStore } from './stores/user';

const app = createApp(App);
const pinia = createPinia();
app.use(pinia);
app.use(router); // 使用路由配置
app.use(ElementPlus);
app.use(Vant);

const userStore = useUserStore(pinia);
userStore.initUser(); 

app.mount('#app');